import React, {
	Component
} from 'react'
import {
	inject,
	observer
} from 'mobx-react';
import {
	Tools
} from "weaver-mobile";
import '../../style/resource.less';
import TitlePage from '../coms/TitlePage';
import SearchCondition from './search/SearchCondition';
import SearchList from './list/SearchList';
const getLabel = Tools.getLabel;

@inject('resourceStore')
@observer
export default class Subordinate extends Component {
	componentDidMount() {
		this.init()
	}

	init = () => {
		const {
			resourceStore,
			match: {
				params: {
					id
				}
			}
		} = this.props;
		resourceStore.setHrmId(id);
		resourceStore.init();
	}

	render() {
		const {
			resourceStore
		} = this.props;

		const {
			lastname
		} = resourceStore;

		let title;
		if(lastname != null && lastname != '')
			title = `${lastname}${getLabel(500942,'的下属')}`;

		return (
            <TitlePage title={title}>
                <SearchCondition store={resourceStore} />
				<SearchList store={resourceStore} />
            </TitlePage>
		)
	}
}